This simulation implements the sample mean and importance sampling techniques of Monte Carlo integration. The user can input a 1D integrand and finite integration limits and specify the required Monte Carlo technique or techniques.
The importance sampling technique requires the user to input a normalised probability distribution p(x) that matches the integrand in its main features, and an associated transformation law x(y) that converts a uniform y in [0,1) into an x sampled according to p(x). The simulation does perform a check on the normalisation of p(x), but the result may be inaccurate for distributions defined over a very large interval or those with strange behaviour.
The number of trials and the number of separate runs can be chosen by the user.